Skip to content

fix(pm-aggregator): show ready-for-agent dispatch state - #5283

Merged
dezren39 merged 3 commits into
mainfrom
queue/8108-4969-ready-agent-item-dispatch
Nov 7, 2026
Merged

dezren39 merged 3 commits into
mainfrom
queue/8108-4969-ready-agent-item-dispatch

Conversation

@dezren39

@dezren39 dezren39 commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Stop treating the ready-for-agent label alone as evidence that work is implementing.
  • Add a ready-for-agent dispatch read to item HTML and a JSON twin at /api/item/:id.json, including provenance and explicit not picked up state.
  • Cover the item surfaces and the label-only classification with fixture-backed tests.

Closes #4969

Verification

  • bun test test/render.test.ts test/boot.test.ts test/ready-for-agent.test.ts — 48 passed.
  • git diff --check — clean.
  • bun run typecheck could not run: the fresh worktree does not have the bun type definitions installed (TS2688).

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 4, 2026 04:33
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f11f2b98-881d-44cc-8465-b9bee56f9cb1
Commits

Reviewing files that changed from the base of the PR and between f235cef and 54f95ab.

Files selected for processing: 5

  • pm-stack/aggregator/src/derive.ts
  • pm-stack/aggregator/src/render.ts
  • pm-stack/aggregator/src/server.ts
  • pm-stack/aggregator/test/boot.test.ts
  • pm-stack/aggregator/test/render.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T04:23:07.468566Z 54f95ab New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb0ac58833

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (!targets.length) return [];
const observedAt = new Date().toISOString();
try {
const state = await fetchRfaState(cfg.readyForAgent.baseUrl);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep fixture-mode dispatch reads off the live harness

When PM_AGG_SOURCE=fixtures (the default), opening the fixture dispatch-trial item now performs real GraphQL requests against the configured harness and attaches live dispatch state to canned issue data. Without a running harness, the same fixture instead reports unavailable, making this surface environment-dependent. The existing harness integration in health.ts explicitly skips live reads in fixtures mode. Apply the same boundary here and supply deterministic fixture dispatch data; the new boot test currently accepts unavailable because it only checks that the state is truthy.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 66db0aa: fixtures mode (cfg.source !== live) no longer calls fetchRfaState — readyAgentDispatchStates returns deterministic fixture data (RFA_NOT_PICKED_UP with mode=fixtures provenance), mirroring the health.ts boundary. The boot test now asserts the exact state "not picked up" instead of any truthy state.

Comment on lines +1967 to +1968
const matchedItemPath = itemJsonMatch ?? itemMatch;
if (matchedItemPath) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return a JSON error for unresolved API item IDs

When /api/item/<id>.json references an unknown or deleted item, this shared handler falls through to the existing HTML Not found response rather than returning JSON. A machine consumer parsing the JSON endpoint's response therefore receives a parsing error instead of a structured 404. Handle the API miss separately, using the existing notFoundResponse(path) helper or a JSON error response, while preserving the HTML response for /item/<id>.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 66db0aa: an unresolved /api/item/.json now returns notFoundResponse(path) (structured JSON 404) while /item/ keeps the HTML 404. Covered by a new boot test asserting JSON 404 + content-type for the API path and HTML 404 for the page path.

repo-worker-code-z added 2 commits November 6, 2026 22:08
# Conflicts:
#	pm-stack/aggregator/src/render.ts
#	pm-stack/aggregator/src/server.ts
#	pm-stack/aggregator/test/render.test.ts
@dezren39
dezren39 merged commit 17eb1cb into main Nov 7, 2026
6 of 8 checks passed
@dezren39
dezren39 deleted the queue/8108-4969-ready-agent-item-dispatch branch November 7, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ready-for-agent: surface per-issue dispatch state on the item view (residual of #1203)

1 participant